<?php

namespace app\api\controller;

use \tpfcore\Core;

/**
 * @title   小程序商城接口类
 * @description
 * @group   小程序接口
 * Class ProgramSlide
 * @package app\api\controller
 */
class Cart extends ApiBase
{
    /**
     * @title       购物车列表
     * @description 购物车列表
     * @author      TPFrame
     * @url         /api/Cart/vlist/
     * @method POST
     * @param_send  name:api_version type:string require:1 default:"" other:格式x.x.x desc:版本号
     */
    public function vlist()
    {
        switch ($this->api_version) {
            case '1.0':
                $this->jump(Core::loadModel($this->name)->getCart($this->param));
                break;
            default:
                $this->jump([40048, '版本号错误']);
                break;
        }
    }
    // 操作选中状态
    public function opSelect(){
        switch ($this->api_version) {
            case '1.0':
                $this->jump(Core::loadModel($this->name)->opSelect($this->param));
                break;
            default:
                $this->jump([40048, '版本号错误']);
                break;
        }
    }
    public function settlement(){
        switch ($this->api_version) {
            case '1.0':
                $this->jump(Core::loadModel($this->name)->settlement($this->param));
                break;
            default:
                $this->jump([40048, '版本号错误']);
                break;
        }
    }
    //操作购物车
    public function opCart(){
        switch ($this->api_version) {
            case '1.0':
                $this->jump(Core::loadModel($this->name)->opCart($this->param));
                break;
            default:
                $this->jump([40048, '版本号错误']);
                break;
        }
    }
}